<?php if(!defined('IN_DISCUZ')) exit('Access Denied'); hookscriptoutput('guidelist');?><?php include template('common/header'); require_once("template/banzhuan_weibo/touch/forum/thread_list.php");?><!-- header start -->
<div class="mobile">
<?php if($_G['setting']['domain']['app']['mobile']) { $nav = 'http://'.$_G['setting']['domain']['app']['mobile'];?><?php } else { $nav = "forum.php";?><?php } ?>
<div class="mobile-inner bz">
<div class="mobile-inner-header">
<div class="mobile-inner-header-icon mobile-inner-header-icon-out"><a><span></span><span></span></a></div>
<h3>
<ul>
            <li<?php if($_GET[ 'order']=='dateline' || $_GET[ 'order']=='' ) { ?> class="a" <?php } ?>>
        <a href="bzweibo.php?order=dateline">Latest</a>
        </li>
        <li<?php if($_GET[ 'order']=='replies' ) { ?> class="a" <?php } ?>>
        <a href="bzweibo.php?order=replies">Hot reply</a>
        </li>
        <li<?php if($_GET[ 'order']=='views' ) { ?> class="a" <?php } ?>>
        <a href="bzweibo.php?order=views">Hot views</a>
        </li>
        </ul>	
</h3>
<div class="banzhuan-discuz-header-y"><a href="<?php if($_GET['mod'] == 'forumdisplay' || $_GET['mod'] == 'viewthread') { ?>forum.php?mod=post&action=newthread&fid=<?php echo $_G['fid'];?><?php } else { ?>forum.php?mod=misc&action=nav<?php } ?>" class="iconfont icon-fatie"></a></div>
</div>
<div class="mobile-inner-nav bz">
<div class="banzhuan-h10"></div>
<div class="mobile-inner-nav-list">

    <a href="search.php?mod=forum&amp;mobile=2" style="animation-delay: 0.1s;"><em class="iconfont icon-search"></em>&nbsp;&nbsp;search</a>
    <a href="<?php if($_GET['mod'] == 'forumdisplay' || $_GET['mod'] == 'viewthread') { ?>forum.php?mod=post&action=newthread&fid=<?php echo $_G['fid'];?><?php } else { ?>forum.php?mod=misc&action=nav<?php } ?>" style="animation-delay: 0.2s;"><em class="iconfont icon-fatie"></em>&nbsp;&nbsp;Post</a>
</div>
</div>
</div>
</div>
<script>
$(window).load(function () {
  $(".mobile-inner-header-icon").click(function(){
  	$(this).toggleClass("mobile-inner-header-icon-click mobile-inner-header-icon-out");
  	$(".mobile-inner-nav").slideToggle(250);
  });
  $(".mobile-inner-nav a").each(function( index ) {
  	$( this ).css({'animation-delay': (index/10)+'s'});
  });
});
</script>
<div class="banzhuan-top"></div>
<!-- header end -->

<div class="bz-bg-f5f5f5" style="position: relative;"><?php $list_count=0;?><?php if(is_array($manylist)) foreach($manylist as $thread) { $list_count+=1;?><div class="bz-mt10 bz-card"><?php $gr_uid = DB::result(DB::query("SELECT gr_uid FROM ".DB::table('common_member')." WHERE `uid`= '$thread[authorid]'"));?><?php $gr_uid=$gr_uid?$gr_uid:0;$gr_type = DB::result(DB::query("SELECT gr_type FROM gr_users WHERE `id`= '$gr_uid'"));?><?php $discuz_uid = $_G[uid]?$_G[uid]:'0';?><?php $discuz_gr_uid = DB::result(DB::query("SELECT gr_uid FROM ".DB::table('common_member')." WHERE `uid`=$discuz_uid"));?><?php $discuz_gr_uid= $discuz_gr_uid?$discuz_gr_uid:0;$discuz_gr_type = DB::result(DB::query("SELECT gr_type FROM gr_users WHERE `id`=$discuz_gr_uid"));?><?php if($discuz_gr_type==4 && $gr_type==4 && $gr_uid!=$discuz_gr_uid) { continue;?><?php } ?>
<header class="weibo-header">
<div class="weibo-header-left">
        <a href="home.php?mod=space&amp;uid=<?php echo $thread['authorid'];?>&amp;do=profile&amp;mobile=2"><img src="uc_server/avatar.php?uid=<?php echo $thread['authorid'];?>&amp;size=midlle"/></a>
    </div>
    	<div class="weibo-header-middle">
    <div class="name">
    	    <a href="home.php?mod=space&amp;uid=<?php echo $thread['authorid'];?>&amp;do=index">
    	    	    <?php echo $thread['author'];?>

    	    	    	<?php if($thread['gender'] == 0) { ?>
                        <?php } ?>
                        <?php if($thread['gender'] == 1) { ?>
                  	    <i class="iconfont icon-shouyezhuyetubiao06 color-nan"></i>
                        <?php } ?>
                        	<?php if($thread['gender'] == 2) { ?>
                  	    <i class="iconfont icon-iconfontshouyezhuyetubiao07 color-nv"></i>
                        <?php } ?>                        
    	    </a>
    </div>
    <div class="time-from">
    	    <span class="color-c"><?php echo date('Y-m-d H:i', $thread['dateline']);; ?></span>
    	    <?php if($thread['groupid'] < 4) { ?>
    	    <em class="group-3"><?php echo $thread['grouptitle'];?></em>
    	    <?php } else { ?>
    	    <em class="group-other"><?php echo $thread['grouptitle'];?></em>
    	    <?php } ?>
    </div>
    </div>
    <div class="weibo-header-right">
                    <a href="forum.php?mod=forumdisplay&amp;fid=<?php echo $thread['fid'];?>&amp;filter=lastpost&amp;orderby=lastpost&amp;mobile=2" class="color-c">#<?php echo $thread['name'];?></a>
    </div>
</header>
        <section class="weibo-detail">
            <a href="forum.php?mod=viewthread&amp;tid=<?php echo $thread['tid'];?>" onclick="atarget(this)" title="<?php echo $thread['subject'];?>">
        <h2><?php echo $thread['subject'];?></h2>
        <p class="color-c"><?php echo cutstr($thread['message'],150); ?></p>
    <?php if($thread['attachment'] == 2) { ?>
        <?php $table='forum_attachment_'.substr($thread['tid'], -1);?>        <?php $query = DB::fetch_all("SELECT aid,tid,description,filename FROM ".DB::table($table)." WHERE tid='$thread[tid]' AND isimage!=0 ORDER BY `dateline` DESC LIMIT 0,12");?>        <?php $thread['pics']=count($query);?>        
            <?php $picnum = count($query);?>            
    <?php if($picnum > 8) { ?>
    <?php $litpicnum = '9';?>    <?php } else { ?>
    <?php $litpicnum = $picnum ;?>    <?php } ?>
        	
            <?php $query2 = DB::fetch_all("SELECT aid,tid,description,filename FROM ".DB::table($table)." WHERE tid='$thread[tid]' AND isimage!=0 ORDER BY `dateline` DESC LIMIT 0,$litpicnum");?>        
<?php if($litpicnum == 0) { ?> 
            
            <?php } elseif($litpicnum == 1) { ?> 
            <div class="bz-wall-list-1">
            <?php if(is_array($query2)) foreach($query2 as $pic) { ?>                <div class="z picbox"><a href="forum.php?mod=viewthread&amp;tid=<?php echo $thread['tid'];?>#aimg_<?php echo $pic['aid'];?>"><img src="<?php echo(getforumimg($pic[aid]))?>" /></a></div>
            <?php } ?>
            </div>          
            
            <?php } elseif($litpicnum == 4) { ?>
            <div class="bz-wall-list-4">
            <?php if(is_array($query2)) foreach($query2 as $pic) { ?>                <div class="z picbox"><a href="forum.php?mod=viewthread&amp;tid=<?php echo $thread['tid'];?>#aimg_<?php echo $pic['aid'];?>"><img src="<?php echo(getforumimg($pic[aid]))?>" /></a></div>
            <?php } ?>
            </div>
            
            <?php } else { ?>
            <div class="bz-wall-list-other">
            <?php if(is_array($query2)) foreach($query2 as $pic) { ?>                <div class="z picbox"><a href="forum.php?mod=viewthread&amp;tid=<?php echo $thread['tid'];?>#aimg_<?php echo $pic['aid'];?>"><img src="<?php echo(getforumimg($pic[aid]))?>" /></a></div>
            <?php } ?>
            </div>
            <?php } ?>

        <?php } ?>
    </a>
</section>
<div class="banzhuan-clear"></div>
<footer class="weibo-footer bz">
    <ul>
        <li><a href="forum.php?mod=viewthread&amp;tid=<?php echo $thread['tid'];?>"><i class="iconfont icon-attention color-c"></i><em class="color-c"><?php echo $thread['views'];?></em></a></li>
        <li class="ping"><a href="forum.php?mod=viewthread&amp;tid=<?php echo $thread['tid'];?>"><i class="iconfont icon-comment color-c"></i><em class="color-c"><?php echo $thread['replies'];?></em></a></li>
        <li><a href="forum.php?mod=viewthread&amp;tid=<?php echo $thread['tid'];?>"><i class="iconfont icon-appreciatelight color-c"></i><em class="color-c"><?php echo $thread['recommend_add'];?></em></a></li>
    </ul>
   </footer>
</div>
<?php } ?>
</div>
<?php if($_GET['order']) { if($allnum>$num) { } } ?>

<?php echo $pagenav;?><?php include template('common/footer'); ?>